package com.hanhai.material.device.entity;

import com.mybatisflex.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 *  实体类。
 *
 * @author youchuang
 * @since 2024/01/12 17:32:50
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "sys_product_record_shift",dataSource = "device")
public class SysProductRecordShift implements Serializable {
    @Id(keyType = KeyType.None)
    private String id;

    private String workShop;

    private String machineName;

    private String machineArea;

    private String jobNo;

    private String userName;

    private String shift;

    private String shiftCode;

    private String workPlanId;

    private Date productDate;

    private Date actualStartTime;

    private Date actualEndTime;

    private String summary;

    private Date adjustStartTime;

    private Date adjustEndTime;

    private Integer goodNum;

    private Integer badNum;

    private Integer totalNum;

    private Integer goodNumPeople;

    private Integer badNumPeople;

    private Integer totalNumPeople;

    private Integer workPlanProductNum;

    private Integer nowProductNum;

    private boolean isContinue;

    private boolean isEntry;

    private boolean isOver;

    private boolean isNormal;

    private boolean isWarning;

    private Integer totalCount;

    private boolean isStart;

    private String productId;

    private String productName;

    private String shortName;

    private BigDecimal startWeight1;

    private BigDecimal endWeight1;

    private BigDecimal startWeight2;

    private BigDecimal endWeight2;

    private boolean isTwoWeight;

    private BigDecimal weight;

    private boolean hasWeight;

    private boolean isAuto;

    private Integer paperBoxNumber;

    private String exchangeType;

    private boolean moldSame;

    private String endUserName;

    private String endUserId;

    private Integer boxNum;

    private Integer quantity;

    private Integer nowTailBoxCount;

    private Integer lastTailBoxCount;

    private Integer packageBoxNum;


    @Column(onInsertValue = "now()")
    private Date createTime;
    @Column(onUpdateValue = "now()")
    private Date updateTime;
    @RelationOneToOne(selfField = "workPlanId", targetField = "id", dataSource = "scheduling")
    private SysWorkPlan workPlan;

    @RelationOneToOne(selfField = "productId",targetField = "productId",dataSource = "scheduling")
    private SysProductInfo productInfo;

    @Column(ignore = true)
    public List<SysProductRecord> productRecordList;

    @RelationOneToOne(selfField = "machineName", targetField = "machineName", dataSource = "device")
    private SysMachinePlc sysMachinePlc;


    @Column(ignore = true)
    private List<SysBadRecord> badRecordList;

    @Column(ignore = true)
    private Integer zcbl;
    @Column(ignore = true)
    private Integer tjbl;
    @Column(ignore = true)
    private Integer zdhbl;
    @Column(ignore = true)
    private Integer llbl;
    @Column(ignore = true)
    private Integer qtbl;
    @Column(ignore = true)
    private Integer pzlq;

    @Column(ignore = true)
    private String lineManager;

    @Column(ignore = true)
    private SysProductRecordDetention productRecordDetention;

    private Integer totalInto;

    private Integer totalTodayPeopleInto;

    private Integer totalHandleInto;

    private String updateUserId;
    private String updateUserName;

    private String productRecordId;
    private double adjustMachineDuration;
    private String adjustMachineReason;
    private int differentNum;

    private String groupName;

    private int otherShiftTailBoxCount;
    private boolean isOtherShiftTailBoxEntry;
    private String otherShiftId;
    private String otherShiftKingId;
    private String otherShiftKingNo;
    @Column(ignore = true)
    private String productIdQuery;
    @Column(ignore = true)
    private LocalDate startDate;
    @Column(ignore = true)
    private LocalDate endDate;
    @Column(ignore = true)
    private List<String> productIds;

}
